/**
 * $Id$
 *
 * @author Noritaka Horio<holy.shared.design@gmail.com>
 * @copyright 2009 Noritaka Horio all rights resrved. 
 * @license The MIT License
 * @version $Revision$
 * @since
 */

var ApplicationContext = new Class({

	initialize: function(context){
		var application = air.NativeApplication.nativeApplication;
		var xmlString = application.applicationDescriptor;
		
		var appXml = new DOMParser();
		var xmlObject = appXml.parseFromString(xmlString, "text/xml");
		
		var root = $(xmlObject).getElement("application");

		this.name = $(root).getElement("name text[xml:lang^=ja]").get("text");
		this.description = $(root).getElement("description text[xml:lang^=ja]").get("text");
		this.version = $(root).getElement("version").get("text");
		this.copyright = $(root).getElement("copyright").get("text");
	},

	/**
	 * @private
	 */
	getName: function() {
		return this.name;
	},

	/**
	 * @private
	 */
	getVersion: function() {
		return this.version;
	},

	/**
	 * @private
	 */
	getDescription: function() {
		return this.description;
	},

	/**
	 * @private
	 */
	getCopyright: function() {
		return this.copyright;
	}

});

